package com.hinnotek.amoeba.adapters.old

import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hinnotek.amoeba.R

class MsgHistoryListAdapter :
    BaseQuickAdapter<MsgHistoryBean, BaseViewHolder>(R.layout.item_msg_history) {
    override fun convert(holder: BaseViewHolder, item: MsgHistoryBean) {
        holder.setText(R.id.tv_msg_applicant, item.createUser)
        holder.setText(R.id.tv_msg_start_date, item.createTime)
        holder.setText(R.id.tv_msg_end_date, item.approvalDate)
        when (item.approvalState) {
            1 -> {
                holder.setText(R.id.tv_msg_status, "阿米巴管理员正在处理中")
                holder.setTextColor(R.id.tv_msg_status, ContextCompat.getColor(context,R.color.minute_yellow)
                )
            }
            2 -> {
                holder.setText(R.id.tv_msg_status, "审批通过")
                holder.setTextColor(R.id.tv_msg_status, ContextCompat.getColor(context,R.color.xui_btn_green_normal_color))
            }
            3 -> {
                holder.setText(R.id.tv_msg_status, "审批拒绝")
                holder.setTextColor(R.id.tv_msg_status, ContextCompat.getColor(context,R.color.xui_config_color_red))
            }
        }
    }
}